<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>百度地图案例</title>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

		<style type="text/css">
		    html{height:100%}
		    body{height:100%;margin:0px;padding:0px}
		    #container{height:100%}
		</style>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=pVFSf9Rxo9PgwG3iq4YMxh906WRVlRlT"></script>
	</head>
	<body>
		<div id="container"></div>

		<script type="text/javascript">
			var map = new BMap.Map("container");

			// // 创建地址解析器实例
			// var myGeo = new BMap.Geocoder();
			// // 将地址解析结果显示在地图上，并调整地图视野
			// myGeo.getPoint("北京尚硅谷", function(point){
			//     if (point) {
			//         map.centerAndZoom(point, 16);
			//         map.addOverlay(new BMap.Marker(point));
			// 		console.log(point.lng+" === "+point.lat);
			//     }else{
			//         console.log("没找到地址。");
			//     }
			// }, "北京市");
			var map = new BMap.Map("container");
			var point = new BMap.Point(116.635648,40.169413);
			var marker = new BMap.Marker(point); // 创建标注
			map.addOverlay(marker);              // 将标注添加到地图中

			map.centerAndZoom(point, 16);
			map.addEventListener("click", function(e){
				alert("当前位置：" + e.point.lng + ", " + e.point.lat);
			});
			map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
		</script>
	</body>
</html>
